package com.xucy.springboot.designmodel.creational.simplefactory;

/**
 * @Author xucy
 * @Date 2019-07-14 11:05
 * @Description 简单工厂实现 jdk中 Calendar jdbc中drivermanager都有使用
 **/

public class TestVideo {

    public static void main(String[] args) {
        //1.简单工厂实现
        VideoFactory videoFactory=new VideoFactory();
        Video video=videoFactory.produceVideo("go");
        if(video==null){
           return;
        }
        video.readVideo();

        //2.传入所需类，提升简单工厂的可用性
        VideoFactory videoFactory1=new VideoFactory();
        Video video1=videoFactory1.classProduceVideo(JavaVideo.class);
        if(video==null){
            return;
        }
        video1.readVideo();
    }
}
